Current Location: Home> Function Categories> fmod

fmod

Returns the remainder of the floating point number of division
Name:fmod
Category:math
Programming Language:php
One-line Description:Returns the remainder of the floating point number for division.

Definition and usage

fmod() function returns the floating point remainder of the division.

Example

In this example, we will use the fmod() function to return the remainder of 5/2:

 <?php
$r = fmod ( 5 , 2 ) ;
echo $r
?>

Try it yourself

grammar

 fmod ( x , y )
parameter describe
x Required. A number.
y Required. A number.

illustrate

Returns the floating point remainder obtained by dividing the dividend ( x ) by the divisor ( y ). The remainder (r) is defined as: x = i * y + r, where i is an integer. If y is a non-zero value, the signs of r and x are the same and their number values ​​are less than y .

Similar Functions
Popular Articles